/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bean.timer;

import com.bean.timer.interfaces.AbstractCompositeTimer;
import com.bean.timer.interfaces.TimerListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.*;
import java.io.IOException;
import java.io.Serializable;
import java.net.URISyntaxException;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JPanel;

/**
 *
 * @author sammael
 */
public class CompositeTimer extends AbstractCompositeTimer implements Serializable{
    
    
    private PropertyChangeSupport propertySupport;
    
    public CompositeTimer() {
        propertySupport = new PropertyChangeSupport(this);
        this.setLayout(new BorderLayout(30,30));
        buttonStartStop.setText("Start");
        buttonReset.setText("Reset");
        JPanel panel = new JPanel(new BorderLayout());
        panel.add(buttonStartStop, BorderLayout.NORTH);
        panel.add(buttonReset, BorderLayout.SOUTH);
        this.add(timer, BorderLayout.CENTER);
        this.add(panel,BorderLayout.EAST);
        buttonStartStop.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent arg0) {
               startTimer();
            }
        });
    }

    @Override
    protected void propertyChange(String property, long oldval, long newval) {
        propertySupport.firePropertyChange(property, oldval, newval);
    }

    @Override
    protected void propertyChange(String property, int oldval, int newVal) {
        propertySupport.firePropertyChange(property, oldval, newVal);
    }

    @Override
    protected void propertyChange(String property, Object oldval, Object newVal) {
        propertySupport.firePropertyChange(property, oldval, newVal);
    }

    @Override
    protected void propertyChange(String property, boolean oldval, boolean newVal) {
        propertySupport.firePropertyChange(property, oldval, newVal);
    }

    @Override
    protected void paintComponent(Graphics g) {
      
    }
    
}
